package com.lennon.eoi.executors;

import java.io.OutputStream;

import com.lennon.eoi.executors.export.AbstractEOIHandler;
import com.lennon.eoi.model.EOITaskVO;

/**
 * 任务包装类
 * 
 * @author lennon
 *
 * @param <T>
 * @param <E>
 */
public class EOITaskWrapper<T, E> implements Runnable  {
    
	/** 任务*/
    private EOITaskVO eoiTaskVO;
    
    /** 查询数据的参数*/
    private T queryParamObject;
    
    /** 输出流*/
    private final OutputStream outputStream;
    
    /** 导出任务处理器*/
    private final AbstractEOIHandler<T, E> eoiHandler;
    
    public EOITaskWrapper(EOITaskVO eoiTaskVO, T queryParamObject, AbstractEOIHandler<T, E> eoiHandler, OutputStream outputStream){
        this.eoiTaskVO = eoiTaskVO;
        this.queryParamObject = queryParamObject;
        this.eoiHandler = eoiHandler;
        this.outputStream = outputStream;
    }

    public EOITaskVO getEoiTaskVO() {
        return eoiTaskVO;
    }
    public void setEoiTaskVO(EOITaskVO eoiTaskVO) {
        this.eoiTaskVO = eoiTaskVO;
    }
    public T getQueryParamObject() {
        return queryParamObject;
    }
    public void setQueryParamObject(T queryParamObject) {
        this.queryParamObject = queryParamObject;
    }
    public AbstractEOIHandler<T, E> getEoiHandler() {
        return eoiHandler;
    }

    @Override
    public void run() {
        // TODO Auto-generated method stub
        eoiHandler.handler(outputStream);
    }
}
